package co.yixiang.modules.product.domain;


import co.yixiang.domain.BaseDomain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * <p>
 * 商品点赞和收藏表
 * </p>
 *
 * @author hupeng
 * @since 2019-10-23
 */

@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class YxStoreProductRelation extends BaseDomain {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "用户ID")
    private Long uid;

    @ApiModelProperty(value = "商品ID")
    private Long productId;

    @ApiModelProperty(value = "类型(收藏(collect）、点赞(like)、足迹(foot))")
    private String type;

    @ApiModelProperty(value = "某种类型的商品(普通商品、秒杀商品)")
    private String category;

    public static YxStoreProductRelationBuilder builder() {
        return new YxStoreProductRelationBuilder();
    }


    public static class YxStoreProductRelationBuilder {
        private Long id;
        private Long uid;
        private Long productId;
        private String type;
        private String category;

        YxStoreProductRelationBuilder() {
        }

        public YxStoreProductRelationBuilder id(Long id) {
            this.id = id;
            return this;
        }

        public YxStoreProductRelationBuilder uid(Long uid) {
            this.uid = uid;
            return this;
        }

        public YxStoreProductRelationBuilder productId(Long productId) {
            this.productId = productId;
            return this;
        }

        public YxStoreProductRelationBuilder type(String type) {
            this.type = type;
            return this;
        }

        public YxStoreProductRelationBuilder category(String category) {
            this.category = category;
            return this;
        }

        public YxStoreProductRelation build() {
            return new YxStoreProductRelation(id, uid, productId, type, category);
        }

        public String toString() {
            return "YxStoreProductRelation.YxStoreProductRelationBuilder(id=" + this.id + ", uid=" + this.uid + ", productId=" + this.productId + ", type=" + this.type + ", category=" + this.category + ")";
        }
    }
}
